import { Injectable } from '@angular/core';
import { ToastsManager, ToastOptions } from 'ng2-toastr/ng2-toastr';


@Injectable()
export class ToasterService {

	constructor(private toastr: ToastsManager, private toastOpts: ToastOptions) {
		this.toastOpts.toastLife       = 30000;
		// this.toastOpts.positionClass   = 'toast-top-left';
		this.toastOpts.showCloseButton = true;
		this.toastOpts.dismiss         = 'auto';
		this.toastOpts.animate         = 'flyRight';
		this.toastOpts.enableHTML      = true;
	}


	successful(message: string) {
		this.toastr.success(message);
	}

	information(message: string) {
		this.toastr.info(message);
	}

	warngins(message: string) {
		this.toastr.warning(message);
	}

	errors(message: string) {
		this.toastr.error(message);
	}

	successfuly() {
		this.toastr.success('<sapn style="color: #2acbdc; background: #e5e5e5;">Successfuly !!</span>');
	}
}